import {Text, View, StatusBar, StyleSheet, Switch} from 'react-native';
import React, {Component} from 'react';

export default class StatusBarCom extends Component {
  constructor() {
    super();
    this.state = {
      switchValue: false,
    };
  }
  toggleSwitch = () => {
    this.setState({switchValue: !this.state.switchValue});
  };
  render() {
    return (
      <View style={[styles.container]}>
        <StatusBar hidden={this.state.switchValue} />
        <Switch
          value={this.state.switchValue}
          onValueChange={this.toggleSwitch}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#fff',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
  },
});
